Optimal. Leaf size=112 \[ -\frac {(a+b) (a A-b (A+2 B)) \log (1-\sin (c+d x))}{4 d}+\frac {(a-b) (a A+b (A-2 B)) \log (1+\sin (c+d x))}{4 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (A b+a B+(a A+b B) \sin (c+d x))}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 112, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {2916, 833, 647,
31} \begin {gather*} -\frac {(a+b) (a A-b (A+2 B)) \log (1-\sin (c+d x))}{4 d}+\frac {(a-b) (a A+b (A-2 B)) \log (\sin (c+d x)+1)}{4 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) ((a A+b B) \sin (c+d x)+a B+A b)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 647
Rule 833
Rule 2916
Rubi steps
\begin {align*} \int \sec ^3(c+d x) (a+b \sin (c+d x))^2 (A+B \sin (c+d x)) \, dx &=\frac {b^3 \text {Subst}\left (\int \frac {(a+x)^2 \left (A+\frac {B x}{b}\right )}{\left (b^2-x^2\right )^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (A b+a B+(a A+b B) \sin (c+d x))}{2 d}-\frac {b \text {Subst}\left (\int \frac {-a^2 A+A b^2+2 a b B+2 b B x}{b^2-x^2} \, dx,x,b \sin (c+d x)\right )}{2 d}\\ &=\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (A b+a B+(a A+b B) \sin (c+d x))}{2 d}-\frac {((a-b) (a A+b (A-2 B))) \text {Subst}\left (\int \frac {1}{-b-x} \, dx,x,b \sin (c+d x)\right )}{4 d}+\frac {((a+b) (a A-b (A+2 B))) \text {Subst}\left (\int \frac {1}{b-x} \, dx,x,b \sin (c+d x)\right )}{4 d}\\ &=-\frac {(a+b) (a A-b (A+2 B)) \log (1-\sin (c+d x))}{4 d}+\frac {(a-b) (a A+b (A-2 B)) \log (1+\sin (c+d x))}{4 d}+\frac {\sec ^2(c+d x) (a+b \sin (c+d x)) (A b+a B+(a A+b B) \sin (c+d x))}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.05, size = 174, normalized size = 1.55 \begin {gather*} \frac {\left (a^2-b^2\right ) ((a+b) (a A-b (A+2 B)) \log (1-\sin (c+d x))-(a-b) (a A+b (A-2 B)) \log (1+\sin (c+d x)))-2 a^3 (-A b+a B) \sec ^2(c+d x)-2 \left (a^2-b^2\right ) \left (a^2 A+A b^2+2 a b B\right ) \sec (c+d x) \tan (c+d x)+\left (-6 a^3 A b+4 a A b^3+2 b^4 B\right ) \tan ^2(c+d x)}{4 \left (-a^2+b^2\right ) d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.37, size = 187, normalized size = 1.67
method | result | size |
derivativedivides | \(\frac {a^{2} A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {B \,a^{2}}{2 \cos \left (d x +c \right )^{2}}+\frac {A a b}{\cos \left (d x +c \right )^{2}}+2 B a b \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+B \,b^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(187\) |
default | \(\frac {a^{2} A \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {B \,a^{2}}{2 \cos \left (d x +c \right )^{2}}+\frac {A a b}{\cos \left (d x +c \right )^{2}}+2 B a b \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+A \,b^{2} \left (\frac {\sin ^{3}\left (d x +c \right )}{2 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{2}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+B \,b^{2} \left (\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\cos \left (d x +c \right )\right )\right )}{d}\) | \(187\) |
risch | \(-i B \,b^{2} x -\frac {2 i B \,b^{2} c}{d}-\frac {i \left (A \,a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+A \,b^{2} {\mathrm e}^{3 i \left (d x +c \right )}+2 B a b \,{\mathrm e}^{3 i \left (d x +c \right )}-A \,a^{2} {\mathrm e}^{i \left (d x +c \right )}-A \,b^{2} {\mathrm e}^{i \left (d x +c \right )}+4 i A a b \,{\mathrm e}^{2 i \left (d x +c \right )}-2 B a b \,{\mathrm e}^{i \left (d x +c \right )}+2 i B \,a^{2} {\mathrm e}^{2 i \left (d x +c \right )}+2 i B \,b^{2} {\mathrm e}^{2 i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A \,b^{2}}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B a b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B \,b^{2}}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A \,b^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B a b}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B \,b^{2}}{d}\) | \(345\) |
norman | \(\frac {\frac {\left (a^{2} A +A \,b^{2}+2 B a b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {\left (a^{2} A +A \,b^{2}+2 B a b \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 A a b +2 B \,a^{2}+2 B \,b^{2}}{d}+\frac {4 \left (a^{2} A +A \,b^{2}+2 B a b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {6 \left (a^{2} A +A \,b^{2}+2 B a b \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {4 \left (a^{2} A +A \,b^{2}+2 B a b \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {\left (4 A a b +2 B \,a^{2}+2 B \,b^{2}\right ) \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (10 A a b +5 B \,a^{2}+5 B \,b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (10 A a b +5 B \,a^{2}+5 B \,b^{2}\right ) \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}-\frac {\left (a^{2} A -A \,b^{2}-2 B a b -2 B \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {\left (a^{2} A -A \,b^{2}-2 B a b +2 B \,b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}-\frac {B \,b^{2} \ln \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) | \(418\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 122, normalized size = 1.09 \begin {gather*} \frac {{\left (A a^{2} - 2 \, B a b - {\left (A - 2 \, B\right )} b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (A a^{2} - 2 \, B a b - {\left (A + 2 \, B\right )} b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (B a^{2} + 2 \, A a b + B b^{2} + {\left (A a^{2} + 2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.43, size = 136, normalized size = 1.21 \begin {gather*} \frac {{\left (A a^{2} - 2 \, B a b - {\left (A - 2 \, B\right )} b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (A a^{2} - 2 \, B a b - {\left (A + 2 \, B\right )} b^{2}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, B a^{2} + 4 \, A a b + 2 \, B b^{2} + 2 \, {\left (A a^{2} + 2 \, B a b + A b^{2}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \sin {\left (c + d x \right )}\right ) \left (a + b \sin {\left (c + d x \right )}\right )^{2} \sec ^{3}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.56, size = 146, normalized size = 1.30 \begin {gather*} \frac {{\left (A a^{2} - 2 \, B a b - A b^{2} + 2 \, B b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (A a^{2} - 2 \, B a b - A b^{2} - 2 \, B b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (B b^{2} \sin \left (d x + c\right )^{2} + A a^{2} \sin \left (d x + c\right ) + 2 \, B a b \sin \left (d x + c\right ) + A b^{2} \sin \left (d x + c\right ) + B a^{2} + 2 \, A a b\right )}}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 12.36, size = 118, normalized size = 1.05 \begin {gather*} \frac {\ln \left (\sin \left (c+d\,x\right )+1\right )\,\left (a-b\right )\,\left (A\,a+A\,b-2\,B\,b\right )}{4\,d}-\frac {\sin \left (c+d\,x\right )\,\left (\frac {A\,a^2}{2}+B\,a\,b+\frac {A\,b^2}{2}\right )+\frac {B\,a^2}{2}+\frac {B\,b^2}{2}+A\,a\,b}{d\,\left ({\sin \left (c+d\,x\right )}^2-1\right )}+\frac {\ln \left (\sin \left (c+d\,x\right )-1\right )\,\left (a+b\right )\,\left (A\,b-A\,a+2\,B\,b\right )}{4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________